//
//  HWUtilties.h
//  嗨文
//
//  Created by 响当当 on 2019/1/8.
//  Copyright © 2019年 dongzheng. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface HWUtilties : NSObject

/*
 ** 监控网络状态
 */
+ (void)monitorNetworking;

/**
 * 获取当前屏幕显示的viewcontroller
 */
+ (UIViewController *)getCurrentVC;

/*
 ** 提示操作
 */
+ (void)showAlertWithTitle:(NSString *)titleStr
                   content:(NSString *)eventStr
               buttonTitle:(NSString *)btnTitle
            cancelBtnTitle:(NSString *)cancelBtnTitle
          ConfirmWithBlock:(void(^__weak)(void))comfirm;

/*
 ** 提示操作,不含取消
 
 */
+ (void)showAlertWithTitle:(NSString *)titleStr
                   content:(NSString *)eventStr
               buttonTitle:(NSString *)btnTitle
          ConfirmWithBlock:(void(^__weak)(void))comfirm;

/**
 *    url跳转
 */
+ (void)openUrlSchedule:(NSString *)urlStr;

//这个函数就是将字典封装成转义的JSON字符串
+ (NSString *)toJSONString:(NSDictionary *)dict;

//创建label
+ (UILabel *)creatLabelWithFrame:(CGRect)Rect
                    textAligment:(NSTextAlignment)textAligment
                        textClor:(UIColor *)color
                        textFont:(CGFloat)size;
//创建button
+ (UIButton *)creatButtonWithFrame:(CGRect)Rect
                      textAligment:(NSTextAlignment)textAligment
                              text:(NSString *)title
                          textClor:(UIColor *)color
                         buttonBGC:(UIColor *)bgcColor
                          textFont:(CGFloat)size
                            target:(id)vc
                            method:(SEL)method;

//获取当前的年月
+ (NSString *)getYearAndMonth;

//电话号码
+ (BOOL)checkTel:(NSString *)mobileNumbel;

//时间戳转换成时间
+ (NSString *)getTime:(NSString *)time;

/**
 *  push web
 */
+ (void)pushWebWithUrl:(NSString *)urlStr title:(NSString *)title toUrl:(NSString *)toUrl toId:(NSString *)toId;

//清除cookie
+ (void)removeCookie;

//文字转换
+ (NSString *)adjustParagraphFormat:(NSString *)string;

//获取小说的张数
+(NSArray *)pagingWithContentString:(NSString *)contentString contentSize:(CGSize)contentSize textAttribute:(NSDictionary *)textAttribute;

//获取手机的网络的ip地址
+ (NSString *)getIPAddress;

//url encode 编码
+(NSString*)encodeString:(NSString*)unencodedString;

+(NSString *)URLDecodedString:(NSString *)str;

//获取当前时间戳  （以毫秒为单位）
+(NSString *)getNowTimeTimestamp3;

//字典转json字符串
+ (NSString *)convertToJsonData:(NSDictionary *)dict;

//json字符串转字典
+ (NSDictionary *)dictionaryWithJsonString:(NSString *)jsonString;

//埋点
+ (void)buryPointWithStayTime:(NSString *)stayTime
                    timestamp:(NSString *)timestamp
                     memberId:(NSString *)memberId
                      fromUrl:(NSString *)fromUrl
                        toUrl:(NSString *)toUrl
                       fromId:(NSString *)fromId
                         toId:(NSString *)toId;
//埋点
+ (void)buryPointWithStayTime:(NSString *)stayTime
                    timestamp:(NSString *)timestamp
                     memberId:(NSString *)memberId
                      fromUrl:(NSString *)fromUrl
                        toUrl:(NSString *)toUrl
                       fromId:(NSString *)fromId
                         toId:(NSString *)toId
                    articleId:(NSString *)articleId
                    chapterId:(NSString *)chapterId
                 chapterTotal:(NSString *)chapterTotal;

+ (void)alterUpDateApp;
@end
